<template>
	<view class="content">
		<u-navbar bgColor="#fff" :placeholder="true" :fixed="true" @leftClick="$back" title="dream约文" titleStyle="{'color': '#000'}">
			
		</u-navbar>
		<view class="dl-box display-flex" v-if="id == 14">
			<text @tap="copy(content)">复制</text>
		</view>
		
		<view class="xunli">
		
			<view class="yinbox">
			
				<view class="daotxt">
					<!-- <rich-text :nodes="content | filterRichText"></rich-text> -->
					<u-parse :content="content"></u-parse>
				</view>
			</view>
		</view>
		<!-- <view class="nomore" v-if="logList.length && list.current_page == list.last_page">
			没有更多了~
		</view> -->
	</view>
</template>
<script>
	import uParse from '@/components/u-parse/u-parse.vue'
	export default {
		data() {
			return {
				page: 1,
				list: {},
				logList: [],
				content: "",
				id: ''
			}
		},
		components: {
			uParse
		},
		onLoad(ops) {
			this.id = ops.id;
		},
		onShow() {
			this.getList()
		},
		// 上拉加载
		onReachBottom() {
			
		},
		methods: {
			// 复制
			copy(txt){
				uni.setClipboardData({
					data: txt,
					success: function() {
						console.log('success');
					}
				});
				
				uni.getClipboardData({
					success: function(res) {
						console.log(res.data);
					}
				});
			},
			getList() {
				this.$api.default.request('index/getxieyi_dea', {
					id: this.id
				}, 'POST', false).then((res) => {
					if (res.code) {
						this.content = res.data;
					}
				})
			},
			shownei(item) {
				
				// this.selId = item.id == this.selId ? 0 : item.id
			}
		}
	}
</script>

<style lang="scss">
	.dl-box{
		position: fixed;
		/* #ifndef H5 */
		top: 0;
		/* #endif */
		/* #ifdef H5 */
		top: 45px;
		/* #endif */
		left: 0;
		width: 100%;
		padding: 10rpx 30rpx;
		box-sizing: border-box;
		justify-content: flex-end;
		background: #fff;
		z-index: 99;
		
		text{
			width: 52px;
			height: 20px;
			line-height: 20px;
			text-align: center;
			border-radius: 4px;
			background: #45C4B0;
			font-family: 思源黑体;
			font-size: 12px;
			color: #FFFFFF;
			margin-left: 15rpx;
		}
	}
	
	page {
		background: rgba(242, 245, 242, 1);
	}

	.content {
		padding-top: 10px;

		.xunli {
			background-color: #ffffff;
			margin-bottom: 20rpx;

			.topbox {
				padding: 40rpx 68rpx;
				display: flex;
				align-items: center;
				justify-content: space-between;

				.time {
					font-size: 28rpx;
					font-weight: bold;
					letter-spacing: 0em;
					color: #3D3D3D;
					flex-shrink: 0;
				}

				.txt {
					flex-grow: 1;
					font-size: 28rpx;
					font-weight: normal;
					text-align: right;
					color: #999999;
					padding: 0 20rpx;
				}

				.active {
					color: #45C4B0;
				}

				.rarr {
					width: 40rpx;
					height: 40rpx;
					flex-shrink: 0;
				}

				.xuan {
					transform: rotate(90deg);
				}
			}

			.yinbox {
				box-shadow: 0px 8px 20px 0px rgba(0, 0, 0, 0.07) inset;
				padding: 40rpx 68rpx;
				box-sizing: border-box;
				overflow-x: hidden;

				.yintitle {
					font-size: 32rpx;
					font-weight: bold;
					letter-spacing: 0em;
					color: #3D3D3D;
				}

				.dengtxt {
					font-size: 24rpx;
					font-weight: normal;
					letter-spacing: 0em;
					color: #999999;
					padding-bottom: 12rpx;
				}

				.daotxt {
					font-size: 24rpx;
					font-weight: normal;
					letter-spacing: 0em;
					color: #3D3D3D;
					// line-height: 34rpx;
					word-break: break-all;
				}
			}
		}
	}
</style>